import router from '@/router'
import { useRouter } from 'vue-router'

const ruter = useRouter()

//全局前置守卫
router.beforeEach((to, from, next) => {
  //to: 将要访问的路由
  //from: 从那里来
  //next： 路由的放行函数

  //console.log('全局前置守卫to:', to)
  //console.log('全局前置守卫from:', from)
  //console.log('next:', next)
  next()
})

//全局后置守卫
router.afterEach((to, from) => {
  //to: 将要访问的路由
  //from: 从那里来
  //console.log('全局后置守卫to:', to)
  //console.log('全局后置守卫from:', from)
})
